package com.moneywelcome.atomloanfacade.api;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.moneywelcome.atomloanfacade.info.LoanProductInfo;
import com.moneywelcome.params.PageParam;
import com.moneywelcome.results.Result;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;


@FeignClient(value = "atom-loan",contextId = "LoanProductApi")
public interface LoanProductApi {

    @ApiOperation("通过id查询贷款产品")
    @GetMapping("loanProduct/{loanProductId}")
    Result<LoanProductInfo> getLoanProductById(@PathVariable("loanProductId")Integer loanProductId);

    @ApiOperation("分页获取贷款产品")
    @GetMapping("loanProducts")
    Result<Page<LoanProductInfo>> getLoanProducts(@RequestBody PageParam form);

    @ApiOperation("通过产品可贷款最低评分分页查询贷款产品")
    @GetMapping("loanProducts/{baseGrade}")
    Result<Page<LoanProductInfo>> getLoanProductsByBaseGrade(@PathVariable("baseGrade")Integer baseGrade,@RequestBody PageParam form);
}
